package com.agnes.okhttp.lib;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import com.agnes.okhttp.lib.NetConst;
import com.agnes.okhttp.lib.util.Utils;

import org.json.JSONException;
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
 * Instrumented test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();

        assertEquals("com.qk365.network.test", appContext.getPackageName());
    }


    @Test
    public void testLogin() {
//        String json = "{\"token\":\"5a763b99-30d2-4711-98ea-1ca128d9aa8b\",\"error\":null,\"result\":0}";
//        String json = "{\"result\":0,\"error\":\"成功\",\"customerList\":[]}";
//        String json = "{\"result\":0,\"key\":\"\",\"realTimeRankList\":[],\"currentDay\":\"2018年12月19日\"}";
//        String json = "{\"userAreaIds\":null,\"error\":null,\"message\":null,\"devChangCnt\":0,\"result\":0,\"uid\":0,\"userName\":null,\"serverscenterId\":null,\"position\":null,\"downLoadAppUrl\":null,\"fgyIdUrl\":null,\"mobile\":null,\"userPhoto\":\"\"}";
        String json = "{\"result\":0,\"message\":null}";
        try {
            Utils.toStandard(json,NetConst.FLAG_JO);
        } catch (JSONException e) {
            e.printStackTrace();
        }




    }
}
